<?php
/**
 * @package scuttle
 * @file /admin/actions/TagsViewAction.class.php
 **/

if (!defined('XOOPS_ROOT_PATH')) exit();

require_once XOOPS_MODULE_PATH. '/scuttle/class/AbstractViewAction.class.php';
require_once XOOPS_MODULE_PATH. '/scuttle/admin/include/functions.php';

class Scuttle_TagsViewAction extends Scuttle_AbstractViewAction
{

	var $mConfig = array();

	var $breadCrumbs     = array();
	var $confirmMssage   = null;
	var $moduleHeader    = null;
	var $menuDescription = null;
	function _getId()
	{
		return xoops_getrequest('id');
	}

	function &_getHandler()
	{
		$handler =& xoops_getmodulehandler('tags');
		return $handler;
	}

	function prepare(&$controller, &$xoopsUser, $moduleConfig)
	{
		parent::prepare(&$controller, $xoopsUser, $moduleConfig);
		$this->mConfig = $moduleConfig;
	}
	function getDefaultView(&$controller, &$xoopsUser)
	{


		if ($this->mObject == null) {
			return SC_FRAME_VIEW_ERROR;
		}

		return SC_FRAME_VIEW_INDEX;
	}
	function executeViewIndex(&$controller, &$xoopsUser, &$render)
	{
		global $adminmenu;


		$this->breadCrumbs[]   = array('name' => _AD_SC_TAGS ,'url'  => 'index.php?action=TagsList' ) ;
		$this->breadCrumbs[]   = array('name' => _AD_SC_TAGS_VIEW) ;
		$this->menuDescription = _AD_SC_TAGS_VIEW_DSC ;

		$render->setTemplateName('scuttle_tags_view.html');

		$render->setAttribute('module_info'   , getModuleInfo());
		$render->setAttribute('module_header' , $this->moduleHeader);
		$render->setAttribute('bread_crumbs'  , $this->breadCrumbs);
		$render->setAttribute('set_menu'      , $adminmenu );
		$render->setAttribute('set_menu_no'   , 3);
		$render->setAttribute('set_menu_desc' , $this->menuDescription);
		$render->setAttribute('confirm_mssage', $this->confirmMssage);

		$render->setAttribute('object'        , $this->mObject);
	}

	function executeViewError(&$controller, &$xoopsUser, &$render)
	{
		$controller->executeRedirect('index.php?action=TagsList', 1, _MD_SC_ERROR_NOSUBMITTED);
	}
}
?>
